import api from '@/http/index'

//获取门店列表
export const shopData = (data) => {
    return new Promise((resolve, reject) => {
        api.get('/api/Shop/GetGridJson', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};
// 新建预约
export const NewAppointment = (data) => {
    return new Promise((resolve, reject) => {
        api.post('/api/Appointment/NewAppointment', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};
// 预约列表
export const AppointmentList = (data) => {
    return new Promise((resolve, reject) => {
        api.post('/api/Appointment/AppointmentList', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};

// 修改预约
export const ChangeAppointment = (data) => {
    return new Promise((resolve, reject) => {
        api.post('/api/Appointment/ChangeAppointment', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};

// 取消预约
export const CancelAppointment = (data) => {
    return new Promise((resolve, reject) => {
        api.post('/api/Appointment/CancelAppointment', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};
// 不可预约日期

export const ShopUnavailableHours = (data) => {
    return new Promise((resolve, reject) => {
        api.post('/api/Appointment/ShopUnavailableHours', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};

// 获取预约时间排期
export const GetTimeSchedule = (data) => {
    return new Promise((resolve, reject) => {
        api.post('/api/Appointment/GetTimeSchedule', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};
// 获取排期详情
export const GetAppointmentByDate = (data) => {
    return new Promise((resolve, reject) => {
        api.post('/api/Appointment/GetAppointmentByDate', data).then((res) => {
            resolve(res);
        }).catch(err => {
            reject(err)
        })
    });
};
